package edu.itstudy.control;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import edu.itstudy.bean.User;
import edu.itstudy.services.IUserServices;
import edu.itstudy.services.impl.IUserServicesImpl;

public class IndexServlet extends HttpServlet {
	
private IUserServices iuserServices = new IUserServicesImpl();
	
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		/*
		 * 获取实时热点
		 * 在首页显示
		 */
		List<User> list = iuserServices.getIndexUser();
		request.setAttribute("list", list);
		request.getRequestDispatcher("/WEB-INF/content/index.jsp").forward(request, response);
	}
}
